<include file="Footprint:header"/>
<link rel="stylesheet" href="/assets/activity/footprint/css/detailroute.css">
<include file="Footprint:share_header"/>
</head>
<body>
<div class="wraper">
	<include file="Activity:Footprint:popbox"/>
	<div class="top bg-color{BEESCRM:$color_class}">
		<div class="logobox fl-left" onclick="location.href='{BEESCRM::U('Activity/Footprint/line',array('wechat_id'=>$wechat_id,'act_id'=>$act_id,'color_id'=>$color_id))}'">
			<span class="iconfont icon-zuo"></span>
		</div>
		<div class="title fl-left">
			{BEESCRM:$data.color_value}·{BEESCRM:$data.theme}
			<!-- <img class="img-title" src="/assets/activity/footprint/images/orange.png"/> -->
		</div>
		<div class="rule fl-left" id="foot-rule">活动规则</div>
	</div>
	<div class="user clearfix">
		<div class="photo fl-left"><img src="{BEESCRM:$fans.headimgurl}"></div>
		<span>{BEESCRM:$fans.nickname}</span>
		<a href="javascript:void(0)" class="routemark fl-right">{BEESCRM:$data.name}<span class="trangle-right"></span></a>
		<input type="hidden" id="wechat_id" value="{BEESCRM:$wechat_id}"/>
		<input type="hidden" id="act_id" value="{BEESCRM:$act_id}"/>
	</div>

	<if condition="$color_class eq 1">
		<div class="themes magnifier">
			<img src="/assets/activity/footprint/images/magnifier.png"/>
			<volist name="data.Point" id="vo" key="i">
				<if condition="$vo['type'] eq 1">
					<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if> ' id="magnifier{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
				<else/>
				<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="magnifier{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
	</if>
	</volist>
</div>
<elseif condition="$color_class eq 2"/>
<div class="themes book">
	<img src="/assets/activity/footprint/images/book.png"/>
	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="book{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="book{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>
</div>
<elseif condition="$color_class eq 3"/>
<div class="themes dabai">
	<img src="/assets/activity/footprint/images/dabai.png"/>

	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="dabai{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="dabai{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>

</div>
<elseif condition="$color_class eq 4"/>
<div class="themes model">
	<img src="/assets/activity/footprint/images/model.png"/>
	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="model{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="model{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>
</div>
<elseif condition="$color_class eq 5"/>
<div class="themes canteen">
	<img src="/assets/activity/footprint/images/canteen.png"/>
	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="canteen{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="canteen{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>
</div>
<elseif condition="$color_class eq 6"/>
<div class="themes pavilion">
	<img src="/assets/activity/footprint/images/pavilion.png"/>
	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="pavilion{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="pavilion{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>
</div>
<elseif condition="$color_class eq 7"/>
<div class="themes bridge">
	<img src="/assets/activity/footprint/images/bridge.png"/>
	<volist name="data.Point" id="vo" key="i">
		<if condition="$vo['type'] eq 1">
			<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map <if condition="$vo['point_id'] eq $default_point_id ">check</if>' id="bridge{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}" data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}" data-color-class="{BEESCRM:$color_class}">&#xe606</a>
		<else/>
		<a class='iconfont text-color<if condition="$vo['isQrcode']">{BEESCRM:$color_class}<else/>8</if> normal line-map' id="bridge{BEESCRM:$i}" data-id="{BEESCRM:$vo.point_id}"  data-name="{BEESCRM:$vo.point_name}" data-type="{BEESCRM:$vo.type}">&#xe609</a>
		</if>
	</volist>
</div>
</if>

<a href="<eq name='havePoint' value='1'>{BEESCRM::U('/Activity/Footprint/detail',array('wechat_id'=>$wechat_id,'act_id'=>$act_id, 'point_id' => $default_point_id, 'class' => $color_class,'route' => 1))}<else/> javascript:;</eq>" class="tab-place text-color{BEESCRM:$color_class}" id="line_point">
	<span class="line_point">{BEESCRM:$default_point_name}</span>
	<span class="iconfont icon-you text-color{BEESCRM:$color_class} fl-right"></span>
	<span class="trangle-top"></span>
</a>
<div class="badge marginb-55">
	<if condition="$medal">

		<P>{BEESCRM:$nexttip}</P>
		<!-- <p>获得 {BEESCRM:$data.medal_name} 勋章</p> -->
		<div class="route"><span class="line long"></span></div>
		<div class="route clearfix">
			<volist name="medal" id="m">

				<div class="badge-list fl-left notrecive" onclick="notrecive({BEESCRM:$m['medal_id']})">
					<div class="recive">
						<if condition="$m['medal_log']">
                            <img src="{BEESCRM:$m.picture}" />
                        <else/>
                            <if condition="$m['sort'] eq 3">
                                <img class="gray" src="/assets/activity/footprint/images/03.png"/>
                            <elseif condition="$m['sort'] eq 2"/>
                                <img src="/assets/activity/footprint/images/02.png"/>
                            <elseif condition="$m['sort'] eq 1"/>
                                <img src="/assets/activity/footprint/images/01.png"/>
                            </if>
                        </if>
						<if condition="$m['medal_log']">
							<span class="iconfont icon-duihao duihao"></span>
						</if>
					</div>
					<span class='big-ring border-white fl-left  <if condition="$m['medal_log']">bg-color3 <else/> white </if> '></span>

	<if condition="$m['Prize']">
		<!-- 已领取 未领取 -->
		<span class='iconfont icon-liwu liwu   <if condition="$m['medal_log']"> text-color5 <else/> text-color9 </if> '></span>
	</if>
</div>
</volist>
</div>
</if>
</div>
<div class="btn-box">
	<if condition="($origin neq 'share') || (($origin eq 'share') and ($fans_id eq $from_fans_id))">
		<a href="#" class="btn fl-left bg-color8" id="getCode">扫描二维码</a>
		<a href="#" class="btn fl-left bg-color8" id="share">分享好友</a>
		<else/>
		<a href="http://mp.weixin.qq.com/s?__biz=MzAxOTM0NTE4MQ==&mid=205918667&idx=1&sn=d66943dda3de80c5792eef31b4af1d9a#rd" class="btn fl-left bg-color8 big-btn">参加活动</a>
	</if>
</div>

<volist name="medal" id="vo">
	<div class="pop-box" id="only-cover"></div>
	<div class="pop clearfix" id="prize{BEESCRM:$vo.medal_id}">
		<div class="prize white fl-left"><img src="{BEESCRM:$vo.picture}"/></div>
		<p class="prize-name fl-left">
			<span>{BEESCRM:$data.medal_name} <if condition="$vo.sort eq 3">铜<elseif condition="$vo.sort eq 2"/>银<elseif condition="$vo.sort eq 1"/>金</if>勋章</span>
			<!-- <span>领取条件：激活2个体验点</span> -->
		</p>
		<span class="iconfont icon-guanbi guanbi" onclick="closeBox({BEESCRM:$vo.medal_id})"></span>

		<if condition="$vo.Prize neq null">

			<div class="prize-mes clearfix">
				<div class="mes-left fl-left">
					<img src="{BEESCRM:$vo.Prize.picture}"/>
					<p>价值</p>
					<p>￥{BEESCRM:$vo.Prize.price}</p>
				</div>
				<div class="mes-right fl-left">
					<p>{BEESCRM:$vo['Prize']['name']}</p>
					<p>{BEESCRM:$vo['Prize']['description']}</p>
				</div>
			</div>
		</if>
		<div>
			<if condition="$vo['medal_log'] neq null">
				<if condition="($vo['Prize'] neq null)">
					<if condition="!$vo['Prize']['prize_log'] and ($fans['fans_id'] eq session('fans_id'))">
						<a href="{BEESCRM::U('/Activity/Footprint/prize',array('wechat_id' => $wechat_id,'act_id'=>$act_id,'line_id' =>$line_id,'prize_id'=>$vo['Prize']['prize_id'],'route'=>1))}" class="big-btn btn fl-left bg-color8" id="closePrize">领取奖品</a>
					<elseif condition="$fans['fans_id'] neq session('fans_id')"/>
						<a href="javascript:void(0)" class="big-btn btn fl-left bg-color8"  onclick="closeBox({BEESCRM:$vo.medal_id})">关闭</a>
					<else/>
						<a href="javascript:void(0)" class="big-btn btn fl-left bg-color8"  onclick="closeBox({BEESCRM:$vo.medal_id})">已领取</a>
					</if>
					<else/>
					<a href="javascript:void(0)" class="big-btn btn fl-left bg-color8"  onclick="closeBox({BEESCRM:$vo.medal_id})">关闭</a>
				</if>
				<else/>
				<a href="javascript:void(0)" class="big-btn btn fl-left bg-color8"  onclick="closeBox({BEESCRM:$vo.medal_id})">关闭</a>
			</if>
		</div>
	</div>
</volist>


<div class="pop-box" id="sharebox">
	<div class="share"><img src="/assets/activity/footprint/images/share.png"/></div>
	<div class="main">
		<p class="warming">分享朋友圈</p>
		<p>加入城市体验之旅，创造属于我们的记忆</p>
		<!-- <p>属于我们的记忆</p> -->
		<a class="share-btn">火速分享</a>
	</div>
</div>
<div class="pop-box" id="sharepoint">
	<div class="share"><img src="/assets/activity/footprint/images/share.png"/></div>
	<div class="main">
		<p class="warming">分享朋友圈</p>
		<p>激活本体验点</p>
		<!-- <p>属于我们的记忆</p> -->
		<a class="share-btn">火速分享</a>
	</div>
</div>
<div class="pop-box" id="success_tips">
	<div class="main" style="padding-top: 50%;">
		<p>体验点已被激活！</p>
		<p id='line_notice'>去看看整条线路吧~</p>
		<a class="share-btn" id='success_tips_close'>知道了</a>
	</div>
</div>
<div class="pop-box" id="success_tips2">
	<div class="main" style="padding-top: 50%;">
		<p>体验点已被激活！</p>
		<p>恭喜你获得勋章和奖品</p>
		<p>点击<font class='iconfont icon-liwu text-color5'></font>即可领取</p>
		<a class="share-btn" id='success_tips_close'>去领奖</a>
	</div>
</div>

</div>

<script type="text/javascript">

	$(document).ready(function(){

		//扫码点亮体验点
		var qrcode_success='{BEESCRM:$success}';
		var get_prize='{BEESCRM:$get_prize}';
		if(qrcode_success){
			if(get_prize){
				$('#success_tips2').show();
			}else{
				$('#success_tips').show();
			}
		}
		//扫码点亮提示关闭
		$(document).on('click','#success_tips_close',function(){
			$('#success_tips').hide();
			$('#success_tips2').hide();
		});

		//切换点选项信息
		$(document).on('click','.line-map',function(){
			var wechat_id = $('#wechat_id').val();
			var act_id = $('#act_id').val();
			var type = $(this).data('type');
			var name = $(this).data('name');
			var id = $(this).data('id');
			var color_class = $(this).data('color-class');
			if(type == 1){
				$(".line_point").html(name);
				$("#line_point").attr('href','/Activity/Footprint/detail/wechat_id/'+wechat_id+'/act_id/'+act_id+'/point_id/'+id+'/class/'+color_class).removeClass('share-point');
			}else{
				$(".line_point").html(name);
				$("#line_point").attr('href','javascript:;').addClass('share-point');
			}

		});

		//调起二维码扫一扫
		$(document).on('click','#getCode',function(){
			wx.scanQRCode({
				needResult: 0, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
				}
			});
		});

		var array = ['dabai' , 'magnifier' , 'book' , 'model' , 'bridge' , 'pavilion' , 'canteen'];
		for(var i= 0;i<array.length;i++){
			$('.'+array[i]).on('click','a',function(){
				var share_point_id='{BEESCRM:$share_point_id}';		//分享点亮点
				//分享点亮体验点
				if($(this).data('id')==share_point_id){
					share_callback_url_extend='/share_point_id/'+share_point_id;
				}else{
					share_callback_url_extend='';
				}
				$(this).addClass('check').siblings().removeClass('check');
			});
			$('.'+array[i]).on('click','.check',function(){
				var wechat_id = $('#wechat_id').val();
				var act_id = $('#act_id').val();
				var type = $(this).data('type');
				var name = $(this).data('name');
				var id = $(this).data('id');
				var color_class = $(this).data('color-class');
				if(type == 1){
					$(this).attr('href','/Activity/Footprint/detail/wechat_id/'+wechat_id+'/act_id/'+act_id+'/point_id/'+id+'/class/'+color_class).removeClass('share-point');
				}else{
					$(this).attr('href','javascript:;').addClass('share-point');
				}

			});
		}

	});


	$(document).on('click','.share-point',function(){
		$('#sharepoint').show();
	});
	$(document).on('click','.share-btn',function(){
		$('#sharepoint').hide();
	});
	$(document).on('click','#share',function(){
		$('#sharebox').show();
	});
	$(document).on('click','.share-btn',function(){
		$('#sharebox').hide();
	});
	function notrecive(id){
		$('#only-cover').show();
		$('#prize'+id).addClass('up');
	}

	function closeBox(id){
		$('#only-cover').fadeOut(500);
		$('#prize'+id).removeClass('up');
	}

	$(document).on('click','#closePrize',function(){
		$('#prize').hide();
	});

</script>
</body>

</html>